[R] select values from list using Date as index

Posted by Pieter on Stack Overflow See other posts from Stack Overflow or by Pieter
Published on 2010-04-29T10:44:07Z Indexed on 2010/04/29 11:07 UTC
Read the original article Hit count: 125

Filed under:

Suppose I have a list as follows

bar=c()
bar["1997-10-14"]=1
bar["2001-10-14"]=2
bar["2007-10-14"]=1

How can I select from this list all values for which the index is within a specific date range? So, if I look for all values between "1995-01-01" and "2000-06-01", I should get 1. And similarly for the period "2001-09-01" and "2007-11-04", I should get 2 an 1.

© Stack Overflow or respective owner

Related posts about r